<template>
  <div style="position: absolute;top:20%;left:35%;">
    <el-upload
    class="upload-demo"
    drag
    action="http://localhost:8002/admin/goods/upload"
    :on-success="successUpload"
    multiple>
  <i class="el-icon-upload"></i>
  <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
  <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
  </el-upload>
  <el-input v-model="url" style="margin-top:20px"></el-input>
  </div>
</template>

<script>
export default {
    data(){
      return{
        url:""
      }
    },
    methods:{
      successUpload(url){
        let {data}=url.data;
        this.url=data
      }
    }
}
</script>

<style>

</style>